<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Yamii for Business',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		//if controler is in subfolder admin,
		//then view should have the same structure such as view/admin/index.php
		//'application.controllers.admin.*',
	),

	'modules'=>array(
		'api',
		'apidev',
		// uncomment the following to enable the Gii tool
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'admin',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			//'ipFilters'=>array('127.0.0.1','::1'),
		),
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
			//alpha version
			'loginUrl'=>array('accounts/login'),
		),
		// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			'showScriptName' => false,
			'urlFormat' => 'path',
			'rules' => array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		//This makes the LocalTime class available as Yii::app()->localtime
		'localtime' => array(
			'class' => 'LocalTime',
		),
		'db' => array(
			'connectionString' => 'mysql:host=localhost;dbname=yamiifi_prod1',
			'emulatePrepare' => true,
			'username' => 'yamiifi_prod1',
			'password' => 'yamii_prod1',
			'charset' => 'utf8',
			'enableProfiling' => true,	// enable profiling
			'enableParamLogging' => true,	// enable logging
			//'initSQLs'=>array("SET time_zone='Europe/Helsinki'"),
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			//alpha version
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
		// do not use built-in jquery.js library
		'clientScript'=>array(
			'class' => 'CClientScript',
			'scriptMap' => array(
				'jquery.js'=>false,
				'jquery.min.js'=>false,
			),
			//'coreScriptPosition' => CClientScript::POS_BEGIN,
		),
	),

	//TODO: comment out this line when alpha launch is completed. 2012.06.01 - 2012.08.31
	//alpha version
	'defaultController' => 'accounts',

	// application-level parameters that can be accessed using Yii::app()->params['paramName']
	'params'=>array(
		'version' => 1.5,
		// this is used in contact page
		'adminEmail'=>'business@yamii.fi',
		'pageSize' => 20,
		'uploadUrl' => '/upload/merchants/',
		'uploadPath' => '/upload/merchants/',
		'facebook' => array(
			'appId'  => '422576134463730',
			'secret' => '58aa558cf80ddaad60c732114eeba116',
		),
	),
	
	'language' => 'en_gb',
);